<!doctype html>
<html class="no-js fixed-layout">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>常德市前列腺疾病研究所</title>
  <meta name="description" content="常德市前列腺疾病研究所">
  <meta name="keywords" content="index">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="renderer" content="webkit">
  <meta http-equiv="Cache-Control" content="no-siteapp" />
  <link rel="icon" type="image/png" href="/assets/i/favicon.png">
  <link rel="apple-touch-icon-precomposed" href="/assets/i/app-icon72x72@2x.png">
  <meta name="apple-mobile-web-app-title" content="Amaze UI" />
  <link rel="stylesheet" href="/assets/css/amazeui.min.css"/>
  <link rel="stylesheet" href="/assets/css/admin.css">
  	<script type="text/javascript">
		function serch(){
			var title=$("#title").val();
			window.location.href='/admin/news/serch?title='+title+'&status='+#(status);
		}
		
		
		
		</script>
  <script type="text/javascript">
  function insert(id) {
  	if(id==''){
			window.location.href='/admin/news/form?status='+#(status);
			
		}
		else {
			window.location.href='/admin/news/form?id='+id+"&status="+#(status);
		
		}
	}
  function del(id){
  	
  	if (confirm("真的要删除吗？")){
  		$.ajax({
  			cache: true,
  			type: "POST",
  			url:'/admin/news/delect',
  			data:{"id":id},
  			async: false,
  			error: function(request) {
  				alert("Connection error");
  			},
  			success: function(data) {
  			
  				if(data.err ==2){
  				
  					alert("删除失败");
  				}
  				else {
  					window.location.href='/admin/news?status='+#(status);
  				}
  				
  			}
  		});
  		}else{
  		return false;
  		}
  }
  </script>
</head>
<body>
<!--[if lte IE 9]>
<p class="browsehappy">你正在使用<strong>过时</strong>的浏览器，Amaze UI 暂不支持。 请 <a href="http://browsehappy.com/" target="_blank">升级浏览器</a>
  以获得更好的体验！</p>
<![endif]-->
#if(session.username??==null)
<div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg"><a href="/admin/login">请先登录</a></strong></div>
      </div>
    </div>
    </div>

#else
#@top()
#define topcontent()
#end

<div class="am-cf admin-main">
#@left()
#define leftcontent()
#end

 <!-- content start -->
  <div class="admin-content">
    <div class="admin-content-body">
      <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">#(name)</strong></div>
      </div>

      <hr>
#if(news.totalRow??==0)
<div class="am-g">
         <div class="am-u-sm-12 am-u-md-6">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default" onclick="insert(''); return false;"><span class="am-icon-plus"></span> 新增</button>
            </div>
          </div>
        </div>
        暂无数据
        </div>
        
#elseif(news.list??=="")
<div class="am-g">
         <div class="am-u-sm-12 am-u-md-6">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default" onclick="insert(''); return false;"><span class="am-icon-plus"></span> 新增</button>
            </div>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-input-group am-input-group-sm">
            <input type="text" class="am-form-field" id="title">
          <span class="am-input-group-btn">
            <button class="am-btn am-btn-default" type="button" onclick="serch(); return false;"  >搜索</button>
          </span>
          </div>
        </div>
        </div>
         <div class="am-g">
        <div class="am-u-sm-12">
          <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
              <thead>
              <tr>
                <th class="table-id">ID</th><th class="table-title">标题</th>
                <th class="table-type">阅读数</th>
                <th class="table-author am-hide-sm-only">作者</th>
                <th class="table-date am-hide-sm-only">修改日期</th>
                <th class="table-set">操作</th>
              </tr>
              </thead>
              <tbody>
            
              <tr>
           
                <td colspan="6">暂无信息</td>
               
                
              </tr>
           
              </tbody>
            </table>

          </form>
        </div>
      </div>
#else 
      <div class="am-g">
        <div class="am-u-sm-12 am-u-md-6">
          <div class="am-btn-toolbar">
            <div class="am-btn-group am-btn-group-xs">
              <button type="button" class="am-btn am-btn-default" onclick="insert(''); return false;"><span class="am-icon-plus"></span> 新增</button>
            </div>
          </div>
        </div>
        <div class="am-u-sm-12 am-u-md-3">
          <div class="am-input-group am-input-group-sm">
            <input type="text" class="am-form-field" id="title">
          <span class="am-input-group-btn">
            <button class="am-btn am-btn-default" type="button" onclick="serch(); return false;"  >搜索</button>
          </span>
          </div>
        </div>
      </div>
      <div class="am-g">
        <div class="am-u-sm-12">
          <form class="am-form">
            <table class="am-table am-table-striped am-table-hover table-main">
              <thead>
              <tr>
                <th class="table-id">ID</th><th class="table-title">标题</th>
                <th class="table-type">阅读数</th>
                <th class="table-author am-hide-sm-only">作者</th>
                <th class="table-date am-hide-sm-only">修改日期</th>
                <th class="table-set">操作</th>
              </tr>
              </thead>
              <tbody>
              #for(news :news.list??!=null ? news.list :news)
              <tr>
           
                <td>#(for.count)</td>
                <td>#(news.title)</td>
                <td>#(news.num)</td>
                <td class="am-hide-sm-only">小编</td>
                <td class="am-hide-sm-only">#date(news.createtime,"yyyy-MM-dd")</td>
                <td>
                  <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                      <button class="am-btn am-btn-default am-btn-xs am-text-secondary" onclick="insert('#(news.id)'); return false;"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                      <button class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" onclick="del('#(news.id)'); return false;"><span class="am-icon-trash-o"></span> 删除</button>
                    </div>
                  </div>
                </td>
              </tr>
              #end
              </tbody>
            </table>
            
            #if(news.list??!=null)
    #@paginate(news,"/admin/news?",status)
    #end
          </form>
        </div>
      </div>
 #end
    </div>

    <footer class="admin-content-footer">
      <hr>
      <p class="am-padding-left">© 2017 Weirdor.</p>
    </footer>
  </div>
  <!-- content end -->

</div>

<a href="#" class="am-icon-btn am-icon-th-list am-show-sm-only admin-menu" data-am-offcanvas="{target: '#admin-offcanvas'}"></a>
#end
<!--[if lt IE 9]>
<script src="http://libs.baidu.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->

<!--[if (gte IE 9)|!(IE)]><!-->
<script src="/assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="/assets/js/amazeui.min.js"></script>
<script src="/assets/js/app.js"></script>
</body>
</html>
